<?php
//将指定的表结构导入到指定的discuz_post支持的格式,即导入bigdb
$strBigDBListTableCreateSQL="
CREATE TABLE IF NOT EXISTS`xp121_thread_list` (
  `Id` int(11) NOT NULL auto_increment,
  `typename` varchar(10) default NULL,
  `title` varchar(100) default NULL,
  `link` varchar(255) default NULL,
  `pubtime` varchar(20) default NULL,
  `author` varchar(30) default NULL,
  `lastauthor` varchar(30) default NULL,
  `views` varchar(10) default NULL,
  `lasttime` varchar(20) default NULL,
  `posts` varchar(10) default NULL,
  `pForum` varchar(30) default NULL,
  `sForum` varchar(30) default NULL,
  `FromForumThreadId` int(11) default NULL,
  `newcate` varchar(10) default NULL,
  `haspub` int(11) unsigned default '0',
  PRIMARY KEY  (`Id`),
  UNIQUE KEY `link` (`link`),
  KEY `FromForumThreadId` (`FromForumThreadId`),
  KEY `typename` (`typename`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";

$strBigDBContentTableCreateSQL="
CREATE TABLE `xp121_thread_content` (
  `Id` int(11) NOT NULL auto_increment,
  `tType` varchar(20) default NULL,
  `localThreadId` int(11) default NULL,
  `FromForumThreadId` int(11) default NULL,
  `content` text,
  `haspub` bigint(20) unsigned default '0',
  PRIMARY KEY  (`Id`),
  KEY `localThreadId` (`localThreadId`),
  KEY `FromForumThreadId` (`FromForumThreadId`)
) ENGINE=MyISAM AUTO_INCREMENT=237069 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;";

function importListSqlDataToBigDB(){
	//insert IGNORE into bigdb.mysql51_thread_content (`content`,`localThreadId`,`tType`) select `data` as content ,listId as localThreadId,tType from csdn_new.csdnbbscontent where listId IN (select Id from bigdb.mysql51_thread_list)
	//insert ignore into bigdb.mysql51_thread_list (Id,title,link,pForum,sForum,newcate) select Id,title,url as link,'RD专区' as pForum,cid2 as sForum,'存储过程/函数' as newcate from (select * from csdn_new.csdnbbslist where cid2='Mysql' or title like '%mysql%' ) u where  (title like '%函数%' or title like '%存储过程%') and (title not like '%php%' or title not like '%java%')
	
}


?>